package casts.facebook
{
   import flash.display.MovieClip;
   import flash.display.Sprite;
   import flash.events.Event;
   import flash.geom.Point;
   import flash.text.TextField;
   
   import jp.progression.casts.CastMovieClip;
   
   public class fb_loading extends CastMovieClip
   {
      // fla
      public var tfPerc:TextField;
      public var mcBg:MovieClip;
      
      public function fb_loading(initObject:Object=null)
      {
         super(initObject);
         
         id = 'fb loading';
         group = 'fb';
      }
      
      // --------------------- LINE ---------------------
      
      public function set perc(v:String):void 
      {
         tfPerc.text = v;
      }
      
      // ################### protected ##################
      
      override protected function atCastAdded():void
      {
         // basic
         onStageResize();
         stage.addEventListener(Event.RESIZE, onStageResize);
         
         gotoAndPlay(1);
         
         // text
         tfPerc.text = '';
      }
      
      override protected function atCastRemoved():void
      {
         // basic
         stage.removeEventListener(Event.RESIZE, onStageResize);
      }
      
      // #################### private ###################
      
      private function onStageResize(e:Event = null)
      {
         x = mcBg.width;
         y = mcBg.height;
      }
      
      private function get sw():Number { return stage.stageWidth; }
      private function get sh():Number { return stage.stageHeight; }
      
      // --------------------- LINE ---------------------
      
   }
   
}